<?php
  $Num1 = 4;
  $Num2 = 8;
  $Num3 = 13;
  #加法运算符
  $nu = $Num1+$Num2;
  var_dump($Num1);
  var_dump($Num2);
  var_dump($Num3);
  print('<br>');
  var_dump($Num1*$Num3);

  print('<br>');
  $name = 'winner';
  var_dump($name);
$sex = 'hello';
$sex1 = &$sex;
var_dump($sex1);
$sex1 = 456;
print('<br>');
var_dump($sex);
$winner = 'win';
$win = $$name;
var_dump($win);
print('<br>');

$a = 5;
$b ='5';
var_dump($a==$b);
print('<br>');
var_dump($a===$b);
print('<br>');
var_dump($a!=$b);
print('<br>');
var_dump($a<>$b);
print('<br>');

$a = 78;
$c = $a > 70 ? '及格':'不及格';
var_dump($c);
#isset($value) ? isset($value) : null
$d = 70 ?? NULL;
print('<br>');
var_dump($d);
print('<br>');

$e = true;
$f = true;
$g = false;
$h = false;
var_dump($e&&$f);
print('<br>');
var_dump($e and $f);
print('<br>');
var_dump($e || $f);
print('<br>');
var_dump($e or $f);
print('<br>');
var_dump(!$e);
print('<br>');
var_dump($f xor $g);

print('<br>');

$i = 'winner 老师 最帅';
$j = 'hello';
$j .= $i;
var_dump($j);
print('<br>');

$i = 'winner' . '123456789';
var_dump($i);
print('<br>');
echo $winner5;

print('<br>');

if($name == 'winner'){
  echo '判断正确';
}else{
  echo '判断不正确';
}

print('<br>');

$num = 4;
if($num == 1){
  echo '我是1号数';
}else if($num == 2){
  echo '我是2号数';
}else{
  echo '不存在';
}

print('<br>');

$num1 = mt_rand(1,25);
var_dump($num1);
print('<br>');
switch ($num1){
  case 1 :
    echo '恭喜中奖为1等奖';
  break;
  case 2 :
    echo '恭喜中奖为2等奖';
  break;
  case 3 :
    echo '恭喜中奖为3等奖';
  break;
  default :
    echo '很遗憾,没有中奖';
  break;
}
print('<br>');
$num2 = 1;
while($num2<=100){
  echo '数字'.$num2,'<br>';
  $num2++;
}
print('<br>');

$num3 = 1;
do{
  echo '我现在正在跑第'.$num3.'圈'.'<br>';
  $num3++;
}while($num3<20);

print('<br>');
$nu = 0;
for($i = 1;$i<=100;$i++){
  if($i%2 ==0){
    $nu +=$i;
  }
}
var_dump($nu);

print('<br>');

$students = array(
  '2010'=>'令狐冲',
  '2011'=>'林平之',
  '2012'=>'曲洋',
  '2013'=>'任盈盈',
  '2014'=>'向问天',
  '2015'=>'任我行',
  '2016'=>'冲虚',
  '2017'=>'方正',
  '2018'=>'岳不群',
  '2019'=>'宁中则',
);
#var_dump($students[2011]);
foreach($students as $k=>$stu){
  var_dump($k);
  var_dump($stu);
}

print('<br>');
$man = 18;
if($man >= 18){
  echo '成年期';
}else{
  if($man>=14&&$man<18){
    echo '青春期';
  }else if($man>=7&&$man<14){
    echo '学龄期';
  }
}
print('<br>');
$students1 = array(
  '2010'=>array('令狐冲','59'),
  '2011'=>array('林平之','44'),
  '2012'=>array('曲洋','89'),
  '2013'=>array('任盈盈','92'),
  '2014'=>array('向问天','93'),
  '2015'=>array('任我行','87'),
  '2016'=>array('冲虚','58'),
  '2017'=>array('方正','74'),
  '2018'=>array('岳不群','91'),
  '2019'=>array('宁中则','90'),
);
foreach($students1 as $K=>$V){
  echo '学号',$K;
  foreach($V as $k1=>$v1){
    echo $v1,'<br>';
  }
}
print('<br>');
foreach($students1 as $K=>$V){
  if($K==2017){
    echo '学号',$K;
  foreach($V as $k1=>$v1){
    echo $v1,'<br>';
  }
  }
}








?>